Creating your own Dynamic Campaign
by Home Fries Introduction Creating your own dynamic campaign in Total Air War is much easier than you might think. To create a basic campaign, all you need to do is create five ASCII text files, only two of which are actual datafiles (the other three files are for briefings). Things get more complicated if you wish to adjust orders of battle for different nations, and the most difficult part of creating your own dynamic campaign is making sure it is properly balanced for the difficulty level you want. This article does not address campaign balancing, nor does it address manipulating global campaign files (other than providing a brief primer on how to do so). Its focus is on the mechanics of creating a dynamic campaign and adding it to the list of available campaigns. Required Files This section discusses the five different files required in order to create a new dynamic campaign. Filename Convention You may notice that the filenames for the original DID campaigns are in the form of taw''xx, where' xx 'is a consecutive number starting with "1". The files following this convention are: *taw''xx.cdl (the main campaign scenario datafile) *taw''xx''.tcs (the campaign's scripted events) *taw''xx''.txt (the overall campaign briefing) It is possible to rename these files as you see fit (e.g. HAL11.cdl/tcs/txt); you do not need to stick with the taw''xx'' naming convention. In fact, changing the naming convention is preferred if you create a campaign with a custom order of battle (which is touched on later in this article), as you will not overwrite other savegame files while your custom campaign is loaded. In addition, there are two text files that are to be displayed upon winning or losing the campaign respectively: *win''XX''.txt *lose''XX''.txt These filenames are hardcoded and cannot be changed. Also note that the number in the win/lose files (XX) does not need to match the taw''xx'' number. However, the number (XX) must match the sequence number of the campaign, starting with 1. Again, this is hardcoded into the EXE. The easy way to do this is to look at the line for your campaign in scenario.txt and add 1 to the number next to MISS: MISS 0 "Highland" "taw1" "taw1" -1 USE_BITMAP 0 MISS 1 "Urgent Shield" "taw10" "taw10" -1 USE_BITMAP 9 In this case, the winning text for Highland would be win1.txt, and the losing text for Highland would be lose1.txt. However, the win/lose files for Urgent Shield would be win2.txt/lose2.txt respectively, despite the fact that the mission is listed as taw10. This is because Urgent Shield is the second campaign listed (MISS 1). Campaign Scenario Datafiles Located in the cdl folder, taw''xx''.cdl and''' taw''xx''.tcs''' are the two datafiles required to actually create a dynamic campaign. All they do is set the stage for the conflict by specifying alliances, the duration of the campaign, and the scripted events (to include the entering of a neutral nation into the war or the change of a strategy by one side or the other). Additional details on the specific file compositions can be found here. taw''xx''.cdl Your first order of business is to create this file, or (an easier solution) copy an existing tawxx.cdl file and rename it to the next number in sequence (i.e. taw11.cdl if you have just the original 10 campaigns installed). Then make the requisite adjustments to your file. CDL files set the stage for the dynamic campaign. The first five sections of the CDL file appear to be identical to their counterpart sections in the PDL file for single missions. The first section sets the world, time/date, and weather. Of these, AFAIK only the WORLD_TIME should be changed. Note that the date is in Day/Month/Year format (i.e. European style date). Next, the number of sides is chosen (Protagonist = Team). This is followed by the definition of each protagonist, as well as the composition of each side. Following this, the player side is specified (this should be a side that has the F22, i.e. USA, EGYPT, SAUDI) and the allegiance matrix is set. As far as protagonists go, it is possible to have more than two sides to the conflict. However, each side must have both a row and a column in the allegiance matrix, so if there are 3 protagonists, the allegiance matrix will be a 3x3 instead of the 2x2 seen below. The final two sections are fairly simple, although little is known about them. The TCOM_SCRIPTS section calls the TCS file to be used in this campaign, which is the trigger file for scripted events. I'm not sure what the "1" stands for, but it might be the number of scripts used (opening the possiblility of multiple campaign scripts). Finally, the COMPLETION section appears to be the number of hours available to complete the campaign. ; set the current world, weather and time details WORLD red1000 WEATHER FINE WORLD_TIME 04/04/2016 00:00:00 ; set number of protagonists NUM_PROT 2 ; define each protagonist and the nation members of that group PROT NATO USA ERITREA PROT ARAB_COALITION YEMEN RUSSIAN ; set player nationality PLAYER USA ; set protagonist allegiance matrix ALLMAT ALLY ENEMY ENEMY ALLY ; define the tcom script file TCOM_SCRIPTS 1 taw2.tcs COMPLETION 96 While you are editing tawxx.cdl, make sure to reference the next file you are going to create, tawxx.tcs, in the TCOM_SCRIPTS section of the file. taw''xx''.tcs Again, your best bet is to copy an existing tawxx.tcs and rename it to your new sequence number. The number you use should match both the number used for taw''xx''.cdl, as well as the number in the TCOM_SCRIPTS section of taw''xx''.cdl. The purpose of this file is to dictate scripted events that will happen over the course of this campaign. This involves both scripting the operational strategy for prosecuting the war (i.e. the "Five Rings" operational theory), as well as adding scripted events such as the entry of a nation into the war. Note that this is still a dynamic campaign, but this file dictates the bigger-picture sequence of events specific to the scenario. In this example the PROT_SCRIPT NATO says that the first strategy will be to attack C4 targets, the damage threshold is 10%, and the NATO team will have 10 hours to accomplish this goal. ; taw 2 ; v1.1 changed INF from 50% to 30% - problems with completion ; v1.2 removed DEFD PROT_SCRIPT NATO ATTACK C4 10% 10 HOURS ATTACK AF 10% 12 HOURS ATTACK INF 10% 54 HOURS ; 34 - 1 day 10 hours END_PROT_SCRIPT PROT_SCRIPT ARAB_COALITION ATTACK NAV 70% 8 HOURS ATTACK C4 70% 8 HOURS ATTACK POL 100% 18 HOURS ATTACK AF 50% 18 HOURS ; 34 END_PROT_SCRIPT If you wish to add a neutral nation into the conflict at a specific time, just add the following line in one of the PROT_SCRIPT sections: ALLEG_CHANGE EGYPT ENEMY You may insert any nation (i.e. you don't need to use EGYPT), and the new nation doesn't need to be enemy. "NEUTRAL" and "ALLY" are your other options. Where you insert the ALLEG_CHANGE statement affects the chronology of events. For example (using the TCS file above), if you inserted the ALLEG_CHANGE line between ATTACK C4 and ATTACK AF, then the allegiance change would occur upon completion of the C4 goal, or the expiration of the 10 hour window, whichever comes first. You could use this mechanism to have a belligerent nation change sides to neutral after having their air force eviscerated, or even have a nation switch sides completely (for example, if a certain amount of political targets are removed, which would abstractly trigger a coup). Campaign Scenario Briefings Located in the Briefing folder, the files taw''xx''.txt, win''XX''.txt, and lose''XX''.txt are, respectively, the operational briefing of the scenario, the text displayed upon winning the campaign, and the text displayed upon losing the campaign. Again, you must use the same sequential number used for your CDL and TCS files. There is no specific datafile format here; the file is after all a text document with no delimiter. Just type in what you wish to have displayed. Again, your best bet is to copy the same files from one of the original campaigns, then insert the text where the format best fits. Finally, just a reminder that while the taw''xx''.txt should correspond with your taw''xx''.cdl and taw''xx''.tcs, your win''XX''.txt and lose''XX''.txt must correspond with the sequence in the scenario.txt file. Adding your Dynamic Campaign to the list of available campaigns You will need to manually add your campaign to scenario.txt ''' in the ''f22data'' folder. This is what the file looks like: ; ** Parser Commands ** ; ; ; NUMBER_OF_MISSION_TYPES ; MISSION_TYPE ; MISSION ; BRIEFING_TEXT ; TAW_LOCK 166 NUM_MISS_TYPES 1 NUM_BMPS 10 DEF_BMP 0 0 0 312 115 "\pcx\campaign\camp01.pcx" DEF_BMP 1 0 0 312 115 "\pcx\campaign\camp02.pcx" DEF_BMP 2 0 0 312 115 "\pcx\campaign\camp03.pcx" DEF_BMP 3 0 0 312 115 "\pcx\campaign\camp04.pcx" DEF_BMP 4 0 0 312 115 "\pcx\campaign\camp05.pcx" DEF_BMP 5 0 0 312 115 "\pcx\campaign\camp06.pcx" DEF_BMP 6 0 0 312 115 "\pcx\campaign\camp07.pcx" DEF_BMP 7 0 0 312 115 "\pcx\campaign\camp08.pcx" DEF_BMP 8 0 0 312 115 "\pcx\campaign\camp09.pcx" DEF_BMP 9 0 0 312 115 "\pcx\campaign\camp10.pcx" FADE_COLOURS 13 255 ; Campaign scenarios MISS_TYPE 0 "Custom" 10 0 MISS 0 "Highland" "taw1" "taw1" -1 USE_BITMAP 0 MISS 1 "Urgent Shield" "taw10" "taw10" -1 USE_BITMAP 9 MISS 2 "Strike Force" "taw3" "taw3" -1 USE_BITMAP 2 MISS 3 "Outcast" "taw4" "taw4" -1 USE_BITMAP 3 MISS 4 "Flame Out" "taw5" "taw5" -1 USE_BITMAP 4 MISS 5 "Choke Point" "taw6" "taw6" -1 USE_BITMAP 5 MISS 6 "Thin Line" "taw7" "taw7" -1 USE_BITMAP 6 MISS 7 "Sea Control" "taw8" "taw8" -1 USE_BITMAP 7 MISS 8 "Sea Breeze" "taw9" "taw9" -1 USE_BITMAP 8 MISS 9 "Port of Call" "taw2" "taw2" -1 USE_BITMAP 1 It is important to keep your naming convention consistent with the original TAW campaigns, so if you decide to add your first campaign, it should be called ''taw11''. Then make sure to increment the campaign counter to reflect the addition of your new campaign. For example, if you added Campaign #11, your entry would look like this (carriage returns are to highlight modified entries): MISS_TYPE 0 "Custom" 11 0 MISS 0 "Highland" "taw1" "taw1" -1 USE_BITMAP 0 MISS 1 "Urgent Shield" "taw10" "taw10" -1 USE_BITMAP 9 MISS 2 "Strike Force" "taw3" "taw3" -1 USE_BITMAP 2 MISS 3 "Outcast" "taw4" "taw4" -1 USE_BITMAP 3 MISS 4 "Flame Out" "taw5" "taw5" -1 USE_BITMAP 4 MISS 5 "Choke Point" "taw6" "taw6" -1 USE_BITMAP 5 MISS 6 "Thin Line" "taw7" "taw7" -1 USE_BITMAP 6 MISS 7 "Sea Control" "taw8" "taw8" -1 USE_BITMAP 7 MISS 8 "Sea Breeze" "taw9" "taw9" -1 USE_BITMAP 8 MISS 9 "Port of Call" "taw2" "taw2" -1 USE_BITMAP 1 MISS 10 "Your Campaign Here" "taw11" "taw11" -1 USE BITMAP 2 Where 11 replaces 10 on the MISS_TYPE line from the original file. Likewise, if you wish to add a campaign graphic, you may do so by incrementing the NUM_BMPS value, then adding your own by following the same format. '''NOTE: Additional campaigns are not reflected on your pilot avatar. Flying an additional campaign will be reflected in your Pilot Log (i.e. score, medals, kills, and mission success rate). However, success or failure of an additional campaign is not reflected in your Campaign Log Global Campaign Files There are additional datafiles whose values are applied at the start of every campaign. They are covered in detail in the Campaign Specific Database Files category, but are mentioned here as an option if you wish to change the fundamental make-up of something large-scale (an order of battle, for example). Since these files apply to all campaigns generated in TAW, it is highly recommended that you back-up any of these files prior to modifying it. If your campaign requires these edits, then the way to make this work is the following: #Substitute the existing datafile with your modified datafile(s) prior to launching TAW. I recommend using something like Generic Mod Enabler (found in the TAW 2.0 Customization Menu) to manage the substitutions. #Launch TAW. #Start your new campaign using the new datafiles. #Save and exit the new campaign. #Exit TAW. #Reinsert the original datafile(s). If you use a mod manager, this would be accomplished by disabling the modified datafiles. At this point, the saved campaign should rely on the UDL and MDL files generated upon saving the campaign. You will have your updated order of battle without compromising the existing campaigns. Another (less risky) solution is to create a custom scenario.txt with only campaigns that use your custom OOB, then perform steps 1-3. You will want to change the naming convention of your 3 campaign files (not win/lose) to match your custom OOB (e.g. som''xx''.cdl/tcs/txt if you are making a custom OOB for Somalia) so you do not overwrite your existing default campaign save files. By having a custom scenario.txt, you only display campaigns that use your custom OOB, and if you want to fly the original campaigns, just deactivate the mod in GME (steps 5-6).